import getopt
import sys
import datetime
import Utils

def help():
    print ' -w work day as holiday\n' \
          ' -h holiday as work day\n' \
          ''
def parse():
    workdayasholiday = []
    holidayasworkday = []
    try:
        options,args = getopt.getopt(sys.argv[1:],"w:h:",["workdayasholiday=","holidayasworkday="])
        for name,value in options:
            if name in("-w","--workdayasholiday"):
                if len(value)>0:
                    for day in value.split(","):
                        workdayasholiday.append(day)
            elif name in ("-h","--holidayasworkday"):
                print "holidayasworkday",value
                print len(value)
                if len(value)>0:
                    for day in value.split(","):
                        holidayasworkday.append(day)

    except getopt.GetoptError:
        pass
    return getDates(workdayasholiday),getDates(holidayasworkday)

def getDates(datelist):
    dates = []
    for day in datelist:
        if day.find("-") > 0:
            
            start_date = day.split("-")[0]
            end_date = day.split("-")[1]

            start_date = datetime.datetime.strptime(start_date, "%Y/%m/%d")
            end_date = datetime.datetime.strptime(end_date, "%Y/%m/%d")
            while start_date <= end_date:
                dates.append(start_date.strftime('%Y/%m/%d'))

                start_date += datetime.timedelta(days=1)
        else:
            dates.append(day)
    return dates
if __name__ == '__main__':
    help()
    w,h = parse()
    print w,h